package com.chinasofti.demo;

public class Granddad {
    public void drink(){
        System.out.println("父父类洗澡");
    }
}
class father extends Granddad{
    public void smoke(){
        System.out.println("父类抽烟");
    }
}
class son extends father{
    public static void main(String[] args) {
        son s = new son();
        System.out.println("儿子继承了");
        s.drink();
        System.out.println("儿子也继承了");
        s.smoke();
    }
}